import { IPSTextItem } from './ipstext-item';
import { PSRawItemImplBase } from './psraw-item-impl-base';

export class PSTextItemImpl extends PSRawItemImplBase implements IPSTextItem {
  get caption(): string {
    return this.M.caption;
  }

  get hAlign(): 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFY' {
    return this.M.hAlign || 'LEFT';
  }

  get renderMode(): 'TEXT' | 'HEADING1' | 'HEADING2' | 'HEADING3' | 'HEADING4' | 'HEADING5' | 'HEADING6' | 'PARAGRAPH' {
    return this.M.renderMode;
  }

  get vAlign(): 'TOP' | 'MIDDLE' | 'BOTTOM' {
    return this.M.vAlign || 'MIDDLE';
  }

  get wrapMode(): 'WRAP' | 'NOWRAP' {
    return this.M.wrapMode || 'NOWRAP';
  }

  get cls(): string {
    return 'PSTextItemImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.IPSTextBase' || cls == 'control.rawitem.IPSTextItem') return true;
    return super.instanceof(cls);
  }
}
